<script type="text/javascript">
<!--
function save_listing() {
	document.listing_form.submit();
}
//-->
</script>
<div id="listing_details">
<form method="post" name="listing_form" action="">
	<table border="0" width="100%">
	  <tr>
	    <td colspan="2"><h2><?php echo $unit->address;?></h2></td>
	  </tr>
	  <tr>
	    <td width="20%">Listing Title *: </td>
	    <td><input type="text" size="45" name="units[title]" value="<?php echo $unit->title;?>" /></td>
	  </tr>
	  <tr>
	    <td>Bedrooms: </td>
	    <td><input type="text" size="5" name="units[bedrooms]" value="<?php echo $unit->bedrooms;?>" /></td>
	  </tr>
	  <tr>
	    <td>Bathrooms: </td>
	    <td><input type="text" size="5" name="units[bathrooms]" value="<?php echo $unit->bathrooms;?>" /></td>
	  </tr>
	  <tr>
	    <td colspan="2"><hr /></td>
	  </tr>
	  <tr>
	    <td>Summary: <br />(Limit 250 Characters)</td>
	    <td>
	    	<textarea id="unit_summary" name="units[summary]" cols="50" rows="10" onkeyup="change(this, 250, 'chars_left')"><?php echo $unit->summary;?></textarea><br />
	    	You have <span id="chars_left">250</span> characters left.
	    </td>
	  </tr>
	  <tr>
	    <td colspan="2"><hr /></td>
	  </tr>
	  <tr>
	    <td>Description:</td>
	    <td><?php echo editorArea( 'editor', $unit->description, 'units[description]', '100%;', '250', '10', '30' ) ;?></td>
	  </tr>
	  <tr>
	    <td colspan="2"><hr /></td>
	  </tr>
	  <tr>
	    <td>Virtual Tour Link:</td>
	    <td><input type="text" size="45" name="units[virtual_tour_link]" value="<?php echo $unit->virtual_tour_link;?>" /></td>
	  </tr>
	  <tr>
	    <td colspan="2"><hr /></td>
	  </tr>
	</table>
	<script type="text/javascript">
		change(document.getElementById('unit_summary'), 250, 'chars_left');
	</script>
<input type="hidden" name="form" value="save_listing">
</form>
<?php $KToolBar->addLink('<a href="#" onclick="document.listing_form.submit()"><img border="0" alt="Save" src="'.ADMIN_COMPONENT_PATH.'images/save_f2.png"/><br />Save</a>');?>
<?php $KToolBar->addLink('<a href="?option='.COMPONENT_NAME.'&user=owner&page=home"><img border="0" alt="Cancel" src="'.ADMIN_COMPONENT_PATH.'images/cancel_f2.png"/><br />Cancel</a>');?>
</div>
